<?php

/**
 * 显示提示消息
 * @param  integer  $status 1是失败,0是成功
 * @param  string  $msg    提示消息
 * @param  integer $time   时间,秒
 * @param  string  $url    跳转的URL
 * @return NULL
 */
function show_msg($status, $msg, $time=3, $url="") {
	
	if (empty($url)) {
		$url = $_SERVER['HTTP_REFERER'];
	}

	$style = 'style="color:';
	if ($status == 1)
	{
		$style .= 'red';
	}
	else if ($status == 0)
	{
		$style .= 'green';
	}
	$style .= ';text-align:center; font-size:16px; font-weight:800; width:500px; height:100px;';
	$style .= 'border:1px dotted rgb(200,200,200);line-height:100px; margin:100px auto;"';
	echo '<div '.$style.'>'.$msg.' &nbsp;<span style="color:gray;font-weight:normal">'.$time.'秒 &nbsp;后跳转...</span>'.'</div>';
	echo '<meta http-equiv="refresh" content="'.$time.',url='.$url.'">';
}